/**
 * Created by Administrator on 2017/4/27 0027.
 */
$(function(){


    // ========新增、编辑、删除、分享弹框操作========
    var $bombBoxs = $('.bomb-boxs');
    var $addbomb = $('.addbomb');
    var $editbomb = $('.editbomb');
    var $sharebomb = $('.sharebomb');
    var $delbomb = $('.delbomb');
    var $addTypebomb = $('.addTypebomb');
    var $editTypebomb = $('.editTypebomb');
    var $disposebomb = $('.disposebomb');

    var $addBtn = $('.add-btn');
    var $editBtn = $('.edit-btn');
    var $delBtn = $('.del-btn');
    var $shareBtn = $('.share-btn');
    var $disposeBtn = $('.dispose-btn');

    var $closeBtn = $('.close-btn');
    var $btnQuit = $('.btn-quit');
    //点击新增按钮，新增弹框显示
    $addBtn.click(function () {
        $(this).addClass('active');
        $bombBoxs.css({'display':'block'});
        $addbomb.css({'display':'block'});
    });


    //点击编辑按钮，编辑弹框显示
    $editBtn.click(function () {
        $(this).addClass('active');
        $bombBoxs.css({'display':'block'});
        $editbomb.css({'display':'block'});
    });


    //点击删除按钮，删除弹框显示
    $delBtn.click(function () {
        $(this).addClass('active');
        $bombBoxs.css({'display':'block'});
        $delbomb.css({'display':'block'});
    });


    //点击分享按钮，分享弹框显示
    $shareBtn.click(function () {
        $(this).addClass('active');
        $bombBoxs.css({'display':'block'});
        $sharebomb.css({'display':'block'});
    });

    //点击处理按钮，处理弹框显示
    $disposeBtn.click(function () {
        $(this).addClass('active');
        $bombBoxs.css({'display':'block'});
        $disposebomb.css({'display':'block'});
    });


    //点击新增按钮，新增控制器类型弹框显示
    $addBtn.click(function () {
        $(this).addClass('active');
        $bombBoxs.css({'display':'block'});
        $addTypebomb.css({'display':'block'});
    });

    //点击编辑按钮，编辑控制器类型弹框显示
    $editBtn.click(function () {
        $(this).addClass('active');
        $bombBoxs.css({'display':'block'});
        $editTypebomb.css({'display':'block'});
    });

    //关闭弹框
    $closeBtn.click(function () {
        closeAddBomb ();
        closeDelBomb();
        closeShareBomb ();
        closeEditBomb ();
        closeAddTypebomb ();
        closeEditTypebomb ();
        closeDisposebomb ();

    });
    $btnQuit.click(function () {
        closeAddBomb ();
        closeDelBomb();
        closeShareBomb ();
        closeEditBomb ();
        closeAddTypebomb ();
        closeEditTypebomb ();
    });

    function closeAddBomb (){
        $addBtn.removeClass('active');
        $bombBoxs.css({'display':'none'});
        $addbomb.css({'display':'none'});
    }
    function closeDelBomb () {
        $delBtn.removeClass('active');
        $bombBoxs.css({'display':'none'});
        $delbomb.css({'display':'none'});
    }
    function closeShareBomb () {
        $shareBtn.removeClass('active');
        $bombBoxs.css({'display':'none'});
        $sharebomb.css({'display':'none'});
    }
    function closeEditBomb () {
        $editBtn.removeClass('active');
        $bombBoxs.css({'display':'none'});
        $editbomb.css({'display':'none'});
    }
    function closeAddTypebomb () {
        $addBtn.removeClass('active');
        $bombBoxs.css({'display':'none'});
        $addTypebomb.css({'display':'none'});
    }
    function closeEditTypebomb () {
        $editBtn.removeClass('active');
        $bombBoxs.css({'display':'none'});
        $editTypebomb.css({'display':'none'});
    }
    function closeDisposebomb () {
        $disposeBtn.removeClass('active');
        $bombBoxs.css({'display':'none'});
        $disposebomb.css({'display':'none'});
    }


})